-
Notifications
You must be signed in to change notification settings - Fork 33
Add web socket interception example #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add web socket interception example #194
Conversation
vladimir-ikryanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply the same changes to the Kotlin example.
examples/src/main/java/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.java
Outdated
Show resolved
Hide resolved
| return InjectJsCallback.Response.proceed(); | ||
| }); | ||
|
|
||
| browser.navigation().loadUrlAndWait("https://www.teamdev.com/jxbrowser#features"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes no sense to load this page as it doesn't use WebSockets AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the examples to use a local HTML file that manages the socket lifecycle. I propose making the examples UI-based.
examples/src/main/java/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.java
Outdated
Show resolved
Hide resolved
examples/src/main/kotlin/com/teamdev/jxbrowser/examples/WebSocketDataInterceptor.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Vladimir Ikryanov <vladimir.ikryanov@teamdev.com>
Use local HTML for testing
This PR introduces Java and Kotlin examples for web socket data interceptions using JS-Java/Kotlin bridge.
Issue: https://github.com/TeamDev-IP/JxBrowser/issues/4829